function ajax() {
    return new Promise((resolve,reject)=>{
        setTimeout(()=>{
            reject('Ajax get data error.');
        },Math.random()*100|0);
    });
}


test('toMatch',()=>{
    return ajax().catch(err=>{
        expect(err).toMatch('error');
    });
});